package org.example.text04;

/**
 * 节目类
 */

public class Program {
    private Performer[] ps;//创建数组
    public Program(){
        ps = new Performer[3];
        ps[0] = new Singer();
        ps[1] = new Dancer();
        ps[2] = new Player();
    }
    void show(){
        for (int i = 0; i < ps.length; i++) {
                ps[i].perform();
        }
    }

    public static void main(String[] args) {
        Program program = new Program();
        program.show();
    }
}
